#include <limits.h>


#include "graph.hh"
#include "construct_greedy_randomized_solution.hh"
#include "local_search_neighborhood_randomly.hh"
#include "local_search_key_path.hh"
#include "utilis.hh"

using namespace std;



int test_local_search_neighborhood_randomly(int argc, char *argv[])
{
	srand(time(NULL));

	int k = 12; // An integer more than 1
	//int max_iter = 50; // An integer more than 1;
	double beta = 0.02; // An double between (0, 1)
	//double alpha = 0.02; // An double between (0, 1)
	//int size_pool = 20; // An integer more than 1;

	if(argc<2) cout << "Invalid arguments" << endl;

	char * path_file_in = argv[1]; // Load from argv[]
	//char * path_file_out = argv[2]; // Load from argv[]
	pair<Graph*, PathMatrix*> * G_P;
	pair<Graph*, PathMatrix*> * G_P_part;
	//list<int> * component_nodes;
	//list<pair<int, int> * > * component_edges;

	cout << "Init(...)" << endl;
	Graph * G = new Graph(path_file_in);

	G_P = ConstructGreedyRandomizedSolution(G, k);
	PrintPartialGraph(G_P->first);
	PrintPathMatrix(G_P->second);

	G_P_part = RemoveOptionalNodesFromRelatedComponentOfOptionals(G_P->first, G_P->second, beta);
	PrintPartialGraph(G_P_part->first);
	PrintPathMatrix(G_P_part->second);

	/*G_P_part = RemoveOptionalEdgesFromRelatedComponentOfTerminals(G_P->first, G_P->second, beta);
	PrintPartialGraph(G_P_part->first);
	PrintPathMatrix(G_P_part->second);*/

	//cout << Random(100) << endl;


	/*cout << "GetNodesOfComponentRelated(2)" << endl;
	component_nodes = GetNodesOfComponentRelated(G, 1);
	PrintListInt(component_nodes);

	cout << "GetNodesOfComponentRelated(7)" << endl;
	component_nodes = GetNodesOfComponentRelated(G, 6);
	PrintListInt(component_nodes);


	cout << "GetEdgesOfComponentRelated(6)" << endl;
	component_edges = GetEdgesOfComponentRelated(G, 5);
	PrintListPairInt(component_edges);


	cout << "GetEdgesOfComponentRelated(9)" << endl;
	component_edges = GetEdgesOfComponentRelated(G, 8);
	PrintListPairInt(component_edges);*/

	cout << "End(...)" << endl;
	return 0;
}



